<?php 
class Admin_Form_Schedule extends Zend_Form{
    
   public function init(){
        $this->setMethod("post");
		$this->setName("ScheduleForm");
        $this->setAttrib('autocomplete', 'off');	        	

        $this->setElementDecorators(array(
            array('ViewHelper'),
            array('Errors'),
            array('Description'),
            array('Label', array('separator'=>' ')),
            array('HtmlTag', array('tag' => 'li', 'class'=>'element-group')),
        ));
        
        $modelDev = new Vina_Model_DeveloperMapper();
        $dataCat = $modelDev->TreeMenu(41);
        $listIdCat[] = 41;
        foreach($dataCat as $vCat):
            $listIdCat[] = $vCat['id'];
        endforeach;
        $stringlistId = implode(',', $listIdCat);
        $news                    = new Vina_Model_News();
        $dataNews                = $news->fetchListToArray("category_id IN($stringlistId)", 'id desc');
        
        foreach($dataNews as $vNews):
            $id = $vNews['id'];
            $optionnews[$id] = $vNews['title'];
        endforeach;
            $optionnews[""] = "-- chọn khóa học --";
        
        
        $news_id = new Zend_Form_Element_Select('news_id');
        $news_id->setLabel('Khóa học')
              ->setMultiOptions($optionnews);
        $news_id->setValue("");
        
        
        $optionWhere["HN"] = "Hà nội";
        $optionWhere["TP HCM"] = "Thành phố HCM";
        $where_id = new Zend_Form_Element_Select('where_leaning');
        $where_id->setLabel('Nơi học')
              ->setMultiOptions($optionWhere);
        $where_id->setValue("");
        
        $time = new Zend_Form_Element_Text('time');
        $time->setLabel('Ngày khai giảng');   
        $time->setAttrib('size', '40');
        
        
        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Save');
        $submit->class = "bt-save";
        
        $this->addElements(array($news_id, $time, $where_id,
        $submit));                                           
    }  
}
